package com.zlmediakit.zlmwebrtc;

import android.Manifest;
import android.content.Intent;
import android.os.Bundle;


import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.view.View;

import pub.devrel.easypermissions.EasyPermissions;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        String[] perms = {Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO};
        EasyPermissions.requestPermissions(MainActivity.this, "需要相机和录音权限", 100, perms);
    }

    public void Push(View view){
        startActivity(new Intent(getApplicationContext(),ZLMediaKitPush.class));
    }

    public void Play(View view){
        startActivity(new Intent(getApplicationContext(),ZLMediaKitPlayer.class));
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
    }
}